欧美一区2区三区4区公司二百,国产精品婷婷午夜在线观看,自拍偷拍亚洲精品,国产美女诱惑一区二区

函數(shù)postgres(二)

函數(shù):chr(int)
說明:Character with the given code. For UTF8 the argument is treated as a Unicode code point. For other multibyte encodings the argument must designate a strictly ASCII character. The NULL (0) character is not allowed because text data types cannot store such bytes. 得到某ACSII值對應(yīng)的字符
例子:chr(65) = A

函數(shù):convert(string bytea, src_encoding name, dest_encoding name)
說 明:Convert string to dest_encoding. The original encoding is specified by src_encoding. The string must be valid in this encoding. Conversions can be defined by CREATE CONVERSION. Also there are some predefined conversions. See Table 9-7 for available conversions. 轉(zhuǎn)換字符串編碼,指定源編碼與目標(biāo)編碼
例子:convert('text_in_utf8', 'UTF8', 'LATIN1') = text_in_utf8 represented in ISO 8859-1 encoding

函數(shù):convert_from(string bytea, src_encoding name)
說 明:Convert string to the database encoding. The original encoding is specified by src_encoding. The string must be valid in this encoding. 轉(zhuǎn)換字符串編碼,自己要指定源編碼,目標(biāo)編碼默認(rèn)為數(shù)據(jù)庫指定編碼,
例子:convert_from('text_in_utf8', 'UTF8') = text_in_utf8 represented in the current database encoding

函數(shù):convert_to(string text, dest_encoding name)
說明:Convert string to dest_encoding.轉(zhuǎn)換字符串編碼,源編碼默認(rèn)為數(shù)據(jù)庫指定編碼,自己要指定目標(biāo)編碼,
例子:convert_to('some text', 'UTF8') = some text represented in the UTF8 encoding

函數(shù):decode(string text, type text)
說明:Decode binary data from string previously encoded with encode. Parameter type is same as in encode. 對字符串按指定的類型進(jìn)行解碼
例子:decode('MTIzAAE=', 'base64') = 123\000\001

函數(shù):encode(data bytea, type text)
說明:Encode binary data to different representation. Supported types are: base64, hex, escape. Escape merely outputs null bytes as \000 and doubles backslashes. 與decode相反,對字符串按指定類型進(jìn)行編碼
例子:encode(E'123\\000\\001', 'base64') = MTIzAAE=

函數(shù):initcap(string)
說明:Convert the first letter of each word to uppercase and the rest to lowercase. Words are sequences of alphanumeric characters separated by non-alphanumeric characters. 將字符串所有的單詞進(jìn)行格式化,首字母大寫,其它為小寫
例子:initcap('hi THOMAS') = Hi Thomas

函數(shù):length(string)
說明:Number of characters in string 講算字符串長度
例子:length('jose') = 4

?

函數(shù):length(stringbytea, encoding name )
說明:Number of characters in string in the given encoding. The string must be valid in this encoding. 計算字符串長度,指定字符串使用的編碼
例子:length('jose', 'UTF8') = 4

*函數(shù):lpad(string text, length int [, fill text])
說 明:Fill up the string to length length by prepending the characters fill (a space by default). If the string is already longer than length then it is truncated (on the right). 對字符串左邊進(jìn)行某類字符自動填充,即不足某一長度,則在左邊自動補(bǔ)上指定的字符串,直至達(dá)到指定長度,可同時指定多個自動填充的字符
例子:lpad('hi', 5, 'xy') = xyxhi

函數(shù):ltrim(string text [, characters text])
說 明:Remove the longest string containing only characters from characters (a space by default) from the start of string 刪除字符串左邊某一些的字符,可以時指定多個要刪除的字符
例子:trim

函數(shù):md5(string)
說明:Calculates the MD5 hash of string, returning the result in hexadecimal 將字符串進(jìn)行md5編碼
例子:md5('abc') = 900150983cd24fb0 d6963f7d28e17f72

*函數(shù):pg_client_encoding()
說明:Current client encoding name 得到pg客戶端編碼
例子:pg_client_encoding() = SQL_ASCII

*函數(shù):quote_ident(string text)
說明:Return the given string suitably quoted to be used as an identifier in an SQL statement string. Quotes are added only if necessary (i.e., if the string contains non-identifier characters or would be case-folded). Embedded quotes are properly doubled. 對某一字符串加上兩引號
例子:quote_ident('Foo bar') = "Foo bar"

*函數(shù):quote_literal(string text)
說明:Return the given string suitably quoted to be used as a string literal in an SQL statement string. Embedded single-quotes and backslashes are properly doubled. 對字符串里兩邊加上單引號,如果字符串里面出現(xiàn)sql編碼的單個單引號,則會被表達(dá)成兩個單引號
例子:quote_literal('O\'Reilly') = 'O''Reilly'

*函數(shù):quote_literal(value anyelement)
說明:Coerce the given value to text and then quote it as a literal. Embedded single-quotes and backslashes are properly doubled. 將一數(shù)值轉(zhuǎn)換為字符串,并為其兩邊加上單引號,如果數(shù)值中間出現(xiàn)了單引號,也會被表示成兩個單引號
例子:quote_literal(42.5) = '42.5'

函數(shù):regexp_matches(string text, pattern text [, flags text])
說 明:Return all captured substrings resulting from matching a POSIX regular expression against the string. See Section 9.7.3 for more information. 對字符串按正則表達(dá)式進(jìn)行匹配,如果存在則會在結(jié)果數(shù)組中表示出來
例子:regexp_matches('foobarbequebaz', '(bar)(beque)') = {bar,beque}

函數(shù):regexp_replace(string text, pattern text, replacement text [, flags text])
說明:Replace substring(s) matching a POSIX regular expression. See Section 9.7.3 for more information. 利用正則表達(dá)式對字符串進(jìn)行替換
例子:regexp_replace('Thomas', '.[mN]a.', 'M') = ThM

*函數(shù):regexp_split_to_array(string text, pattern text [, flags text ])
說明:Split string using a POSIX regular expression as the delimiter. See Section 9.7.3 for more information. 利用正則表達(dá)式將字符串分割成數(shù)組
例子:regexp_split_to_array('hello world', E'\\s+') = {hello,world}

*函數(shù):regexp_split_to_table(string text, pattern text [, flags text])
說明:Split string using a POSIX regular expression as the delimiter. See Section 9.7.3 for more information. 利用正則表達(dá)式將字符串分割成表格
例子:regexp_split_to_table('hello world', E'\\s+') =
hello
world
(2 rows)

*函數(shù):repeat(string text, number int)
說明:Repeat string the specified number of times 重復(fù)字符串一指定次數(shù)
例子:repeat('Pg', 4) = PgPgPgPg

函數(shù):replace(string text, from text, to text)
說明:Replace all occurrences in string of substring from with substring to 將字符的某一子串替換成另一子串
例子:('abcdefabcdef', 'cd', 'XX') = abXXefabXXef

與overlay的功能一樣,

select overlay('http://tp2.sinaimg.cn/1928431341/50/5621497131/1' placing '/180/' from position('/50/' in 'http://tp2.sinaimg.cn/1928431341/50/5621497131/1') for 4), replace('http://tp2.sinaimg.cn/1928431341/50/5621497131/1', '/50/', '/180/');

*函數(shù):rpad(string text, length int [, fill text])
說 明:Fill up the string to length length by appending the characters fill (a space by default). If the string is already longer than length then it is truncated. 對字符串進(jìn)行填充,填充內(nèi)容為指定的字符串
例子:rpad('hi', 5, 'xy') = hixyx

函數(shù):rtrim(string text [, characters text])
說明:Remove the longest string containing only characters from characters (a space by default) from the end of string
去除字符串右邊指定的字符
例子:rtrim('trimxxxx', 'x') = trim

*函數(shù):split_part(string text, delimiter text, field int)
說明:Split string on delimiter and return the given field (counting from one)? 對字符串按指定子串進(jìn)行分割,并返回指定的數(shù)值位置的值
例子:split_part('abc~@~def~@~ghi', '~@~', 2) = def

函數(shù):strpos(string, substring)
說明:Location of specified substring (same as position(substring in string), but note the reversed argument order) 指定字符串在目標(biāo)字符串的位置
例子:strpos('high', 'ig') = 2

與position類似

select strpos('http://tp2.sinaimg.cn/1928431341/50/5621497131/1', '/50/'), position('/50/' in 'http://tp2.sinaimg.cn/1928431341/50/5621497131/1');

函數(shù):substr(string, from [, count])
說明:Extract substring (same as substring(string from from for count)) 截取子串
例子:substr('alphabet', 3, 2) = ph

*函數(shù):to_ascii(string text [, encoding text])
說 明:Convert string to ASCII from another encoding (only supports conversion from LATIN1, LATIN2, LATIN9, and WIN1250 encodings) 將字符串轉(zhuǎn)換成ascii編碼字符串
例子:to_ascii('Karel') = Karel

*函數(shù):to_hex(number int or bigint)
說明:Convert number to its equivalent hexadecimal representation  對數(shù)值進(jìn)行十六進(jìn)制編碼
例子:to_hex(2147483647) = 7fffffff

*函數(shù):translate(string text, from text, to text)
說 明:Any character in string that matches a character in the from set is replaced by the corresponding character in the to set 將字符串中某些匹配的字符替換成指定字符串,目標(biāo)字符與源字符都可以同時指定多個
例子:translate('12345', '14', 'ax') = a23x5

文章鏈接: http://m.qzkangyuan.com/24348.html

文章標(biāo)題:函數(shù)postgres(二)

文章版權(quán):夢飛科技所發(fā)布的內(nèi)容,部分為原創(chuàng)文章,轉(zhuǎn)載請注明來源,網(wǎng)絡(luò)轉(zhuǎn)載文章如有侵權(quán)請聯(lián)系我們!

聲明:本站所有文章,如無特殊說明或標(biāo)注,均為本站原創(chuàng)發(fā)布。任何個人或組織,在未征得本站同意時,禁止復(fù)制、盜用、采集、發(fā)布本站內(nèi)容到任何網(wǎng)站、書籍等各類媒體平臺。如若本站內(nèi)容侵犯了原著者的合法權(quán)益,可聯(lián)系我們進(jìn)行處理。

給TA打賞
共{{data.count}}人
人已打賞
建站教程投稿分享

函數(shù)postgres(一)

2023-10-12 10:16:10

建站教程投稿分享

如何解leetcode Factorial Trailing Zeroes

2023-10-12 10:20:10

0 條回復(fù) A文章作者 M管理員
    暫無討論,說說你的看法吧
?
個人中心
購物車
優(yōu)惠劵
今日簽到
有新私信 私信列表
搜索
主站蜘蛛池模板: 西畴县| 普安县| 淳安县| 聂荣县| 黄石市| 攀枝花市| 泰来县| 鄂托克前旗| 南平市| 霞浦县| 县级市| 磐安县| 思茅市| 杨浦区| 花莲市| 平邑县| 梁平县| 民和| 蒲城县| 离岛区| 义乌市| 特克斯县| 革吉县| 南宁市| 简阳市| 温州市| 德兴市| 大安市| 拉萨市| 肇庆市| 渭南市| 淳安县| 甘泉县| 长宁县| 南平市| 商河县| 壤塘县| 买车| 凤城市| 准格尔旗| 依安县|